// Licensed to Elasticsearch B.V under one or more agreements.
// Elasticsearch B.V licenses this file to you under the Apache 2.0 License.
// See the LICENSE file in the project root for more information.
//
// ███╗   ██╗ ██████╗ ████████╗██╗ ██████╗███████╗
// ████╗  ██║██╔═══██╗╚══██╔══╝██║██╔════╝██╔════╝
// ██╔██╗ ██║██║   ██║   ██║   ██║██║     █████╗
// ██║╚██╗██║██║   ██║   ██║   ██║██║     ██╔══╝
// ██║ ╚████║╚██████╔╝   ██║   ██║╚██████╗███████╗
// ╚═╝  ╚═══╝ ╚═════╝    ╚═╝   ╚═╝ ╚═════╝╚══════╝
// ------------------------------------------------
//
// This file is automatically generated.
// Please do not edit these files manually.
//
// ------------------------------------------------

#nullable restore

using System;
using System.Linq;
using Elastic.Clients.Elasticsearch.Serialization;

namespace Elastic.Clients.Elasticsearch.Aggregations;

[System.Text.Json.Serialization.JsonConverter(typeof(Elastic.Clients.Elasticsearch.Aggregations.Json.StatsBucketAggregateConverter))]
public sealed partial class StatsBucketAggregate : Elastic.Clients.Elasticsearch.Aggregations.IAggregate
{
	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	public StatsBucketAggregate(double? avg, long count, double? max, double? min, double sum)
	{
		Avg = avg;
		Count = count;
		Max = max;
		Min = min;
		Sum = sum;
	}
#if NET7_0_OR_GREATER
	public StatsBucketAggregate()
	{
	}
#endif
#if !NET7_0_OR_GREATER
	[System.Obsolete("The type contains required properties that must be initialized. Please use an alternative constructor to ensure all required values are properly set.")]
	public StatsBucketAggregate()
	{
	}
#endif
	[System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
	internal StatsBucketAggregate(Elastic.Clients.Elasticsearch.Serialization.JsonConstructorSentinel sentinel)
	{
		_ = sentinel;
	}

	public
#if NET7_0_OR_GREATER
	required
#endif
	double? Avg { get; set; }
	public string? AvgAsString { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	long Count { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	double? Max { get; set; }
	public string? MaxAsString { get; set; }
	public System.Collections.Generic.IReadOnlyDictionary<string, object>? Meta { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	double? Min { get; set; }
	public string? MinAsString { get; set; }
	public
#if NET7_0_OR_GREATER
	required
#endif
	double Sum { get; set; }
	public string? SumAsString { get; set; }

	string Elastic.Clients.Elasticsearch.Aggregations.IAggregate.Type => "stats_bucket";
}